function gotoColAbs(x,y)

	n = 0;
  repeat
    if getRobotFlag("collision") then
			n = n + 1;
      print("Collision !")

			if( n == 5) then
			print("5 collisions de suite... on laisse tomber");
			return
			end

      backward(0.3)
      waitUntilIsDone()
    end
    gotoAbs(x,y)
    waitUntilIsDone()
  until not getRobotFlag("collision")
end

math.randomseed(os.time())

repeat
  gotoColAbs(1-2*math.random(),1-2*math.random())
until false

print("Fini !")
